<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/4/3 0003
 * Time: 15:35
 */

namespace app\home\service;


class IdentityService
{
    /**三要素校验
     * @param $userName 姓名
     * @param $userIdCard 身份证
     * @param $userPhoneNo 电话
     * @return mixed
     */
  public static  function identityInfo($userName,$userIdCard,$userPhoneNo){
        $secret='5ca874ed3e8d091fa6bc3bc97eb72909';

        $data=[
            'userName'=>$userName,
            'userIdCard'=>$userIdCard,
            'userPhoneNo'=>$userPhoneNo,
        ];
        $ch = curl_init ();
        curl_setopt ($ch, CURLOPT_URL,'http://bigdata.lvronghui.com/operator3item/verify');
        curl_setopt ($ch, CURLOPT_TIMEOUT,3);
        curl_setopt ($ch, CURLOPT_POST, true );
        curl_setopt ($ch, CURLOPT_HEADER, 0 );
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1 );
        curl_setopt ($ch, CURLOPT_HTTPHEADER, array('secret:'.$secret));
        curl_setopt ($ch, CURLOPT_POSTFIELDS, $data );
        curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // https请求 不验证证书和hosts
        curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
        $query=curl_exec ($ch );
        curl_close ($ch );
        return json_decode($query,true);
    }
}